/**
 * Copyright (c) 2021-2030, NDWP.
 * <p>
 */
package com.example.waternetwork.api.service.impl;

import com.example.waternetwork.api.service.IResDispatch;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.util.UriComponentsBuilder;

import java.net.URI;
import java.util.HashMap;
import java.util.Map;

/**
 * 水库调度
 *
 * @ Author     ：Chenyong.
 * @ Date       ：Created in 13:57 2025/6/17
 */
@Service
public class ResDispatchImpl implements IResDispatch {

    @Autowired
    RestTemplate restTemplate;
    //获取预报调度数据
    @Override
    public   String getForecastData() {
        String url = "http://localhost:8080/api/system/user/page";
        URI uri = UriComponentsBuilder.fromHttpUrl(url)
                .queryParam("current", 1)
                .queryParam("size", 10)
                .build()
                .encode()
                .toUri();
        return restTemplate.getForObject(uri, String.class);
    }
}